﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking2010.Views;
using DevExpress.XtraEditors;
using XCI.Windows;

namespace DevExpress.ApplicationUI.Demos {
    [WidgetCaption("任务Widget")]
    public partial class ToDoList : UserControl, IWidget
    {
        static Font RegularFont = new System.Drawing.Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0);
        static Font StrikeoutFont = new System.Drawing.Font("Segoe UI", 8.25F, FontStyle.Strikeout, GraphicsUnit.Point, 0);
        public ToDoList() {
            InitializeComponent();
        }
        void OnCheckedChanged(object sender, EventArgs e) {
            CheckEdit checkEdit = (sender as CheckEdit);
            if(checkEdit.Checked)
                checkEdit.Font = StrikeoutFont;
            else
                checkEdit.Font = RegularFont;
        }

        public BaseDocument CreateDocument()
        {
            var doc = new XtraBars.Docking2010.Views.Widget.Document
            {
            };
            return doc;
        }

        public Control CreateInstance(Dictionary<string, string> paramMap)
        {
            return new ToDoList();
        }
    }
}
